#include <QDebug>
#include <QTimer>

#include "DesktopActivator.h"

bool DesktopActivator::eventFilter(QObject *obj, QEvent *event)
{
    if (event->type() == QEvent::WindowActivate)
    {
        qDebug() << "Video WindowActivate";
        QTimer::singleShot(100, this, [](){
            system("xdotool search --class dde-desktop windowactivate");
            qDebug() << "Desktop WindowActivate";
        });

    }
    return QObject::eventFilter(obj, event);
}
